<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue.mixin的使用</title>
</head>
<script src="vue.js"></script>
<body>
    <div id="app"></div>
    <script>
        Vue.mixin({
            created(){
                //console.log(this);
                console.log('这是通过混入的created钩子函数');
                var myOption = this.$options.myOption;
                if(myOption){
                    console.log(myOption.toUpperCase());
                }
            },
            data() {
                return{
                    msg:'test'
                }
            }
        });
        var vm = new Vue({
            myOption:'hello vue!'
        })
    </script>
</body>
</html>